import SynchronizationLoginNork from '@/utils/SynchronizationLoginWork'
import Synchronization from "@/utils/Synchronization"
import service from '@/utils/request'
import LoginWork from '@/utils/LoginWork'
// 型体查询
export interface TypeQueryParms {
    colorCode:string,
    pageNum:number,
    pageSize:number,
    styleColor:string,
    styleNo:string
}

export const TypeQuery = (parms:TypeQueryParms) => {
    return service.post<any,any>(`/Cargo/getDevelopBomList`,parms)
}

// 颜色代码
export interface ColorCodePictureParms{
    colorCode:string,
    pageNum:number,
    pageSize:number,
    styleColor:string,
    styleNo:string
}

export interface ColorCodePictureTableDate{
    list:list[]
    total?:number
}

interface list{
    cfmFlag: string,
    styleColor: string,
    colorCode: string,
    photoPath: string
    remark: string
}


export const ColorCodeQuery = (parms:ColorCodePictureParms) => {
    return service.post<any,ColorCodePictureTableDate>(`/Cargo/getDevelopBomPhotoList`,parms)
}

// 型体颜色资料查询
export interface TypeColorDataQueryParms{
    styleNo:string
    styleColor:string
}

export interface TypeColorDataQueryInterface{
    seqNo: string | number,
    partName: any,
    segment: string,
    mtlNo: string,
    mtlName: string,
    mtlColor: string,
    mtlSpec: string,
    mtlUnit: string,
    size1: null,
    size2: null,
    vendor: string,
    usage: null,
    usageType: string,
    drawDept: string,
    sizeType: string,
    mtlProperty: string,
    noLotUsage: null,
    remark: null
}

export const TypeColorDataQuery = (parms:TypeColorDataQueryParms) => {
    return LoginWork.post<any,any>('/Cargo/getDevelopBomUsageList',parms)
}

// 贴合子材料明细查询
export interface LaminatedSubmaterialInterface{
    id: null,
    mtlNo: string,
    mtlColor: null,
    mtlName: string,
    mtlSpec: string,
    mtlUnit: string,
    percent: 1,
    purFlag: string,
    mtlSeq: 2,
    prdType: null,
    vendor: null,
    colorCode: null
}


export const QueryTheDetailsOfTheFitSubMaterial = (parms:any) => {
    return service.post<any,LaminatedSubmaterialInterface[]>('/Cargo/getDetailsOfAdhesiveSubMaterial',parms)
}

// 全码用量资料查询
export interface FullCodeUsageDataParms{
    partName:string,
    segment:number | string,
    styleColor:string,
    styleNo:string
}

export const FullCodeUsageData = (parms:FullCodeUsageDataParms) => {
    return service.post<any,any>(`/Cargo/getFullCodeSizeList`,parms)
}

// 检核
export const FullCodeUsageCheck = (choose:number,parms:any) => {
    return SynchronizationLoginNork.post<any,any>(`/Cargo/getCheckOut/${choose}`,parms)
}   

// 保存
export interface saveDateListParms{
    styleColor:string,
    styleColorMaterialRequests:any[],
    styleColorRemark:string,
    styleNo:string
}

export const saveDateList = (parms:saveDateListParms) => {
    return SynchronizationLoginNork.post<any,any>(`/Cargo/getDevelopBomUsageSave`,parms)
}

// 删除打勾记录型体
export interface DeleteTheCheckmarkedRecordTypePamrs{
    seqNoList:[],
    styleColor:string,
    styleNo:string
}

export const DeleteTheCheckmarkedRecordType = (parms:DeleteTheCheckmarkedRecordTypePamrs) => {
    return SynchronizationLoginNork.post<any,any>('/Cargo/getDeleteTickRecords',parms)
}

// 更新全码用量
export interface UpdateFullCodeUsagePamrs{
    list:any[],
    styleColor:string,
    styleNo:string
}

export const UpdateFullCodeUsage = (parms:UpdateFullCodeUsagePamrs) => {
    return SynchronizationLoginNork.post<any,any>(`/Cargo/getFullCodeDetailRenewA2U`,parms)
}

// 注意事项建档列表
export const PrecautionsFile = (parms:any) => {
    return service.post<any,any>(`/Cargo/getNotesForFilingList`,parms)
}

// 注意事项建档
export const PrecautionsFileList = (parms:any) => {
    return service.post<any,any>(`/Cargo/getNotesForFiling`,parms)
}

// 取研发BOM
export const FetchResearchBom = (parms:any) => {
    return SynchronizationLoginNork.post<any,any>(`/Cargo/getDevelopBom`,parms)
}

// 选择材料当前行正式材料插入
export interface SelectTheCurrentRowToInsertParms{
    colorCode:string,
    mtlColor:string,
    mtlName:string,
    mtlNo:string,
    mtlSpec:string,
    mtlUnit:string,
    partName:string,
    segment:null | string,
    seqNo:string,
    styleColor:string,
    styleNo:string,
    vendor:string
}

export const SelectTheCurrentRowToInsert = (parms:SelectTheCurrentRowToInsertParms) => {
    return SynchronizationLoginNork.post<any,any>(`/date/getChooseCurrentBomMaterials`,parms)
}

// BOM资料删除
export const bomDataDeletion = (parms:any) => {
    return SynchronizationLoginNork.post<any,any>(`/Cargo/getDeleteBomStyleColor`,parms)
}

// 级放基本号码
export interface LevelBasicNumberPamrs{
    baseSize:number | string,
    partName:string,
    segment:number,
    styleColor:string,
    styleNo:string,
    usage:number,
    usageType:string
}

export const LevelBasicNumber = (parms:LevelBasicNumberPamrs) => {
    return SynchronizationLoginNork.post<any,any>(`/Cargo/getPartUsage`,parms)
}

// 颜色代码更新
export const ColorCodeUpdate = (styleNo:string) => {
    return SynchronizationLoginNork.post<any,any>(`/Cargo/ColorCodeUpdate?styleNo=${styleNo}`)
}

// 获取颜色代码 颜色 和图片
export const GetColorOrColorCodeAndImag = (parms:any) => {
    return SynchronizationLoginNork.post<any,any>(`/sell/getSellStyleColorList`,parms)
}

// 修改基本码
export const ubdateSizeNo = (parms:any) => {
    return SynchronizationLoginNork.post<any,any>(`/Cargo/updateBaseSize`,parms)
}